package com.wangshouyu.mp.pay.v3.transactions;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.annotations.SerializedName;

import java.io.Serializable;
import java.util.Objects;

/**
 * @author 王守钰
 * @description 交易回调
 * @date 2020/8/14 17:03
 */
public class TransactionsResponse implements Serializable {

    /**
     * 预支付交易会话标识
     */
    @SerializedName(value = "prepay_id")
    @JsonProperty(value = "prepay_id")
    @JSONField(name = "prepay_id")
    private String prepayId;

    /**
     * 二维码链接
     */
    @SerializedName(value = "code_url")
    @JsonProperty(value = "code_url")
    @JSONField(name = "code_url")
    private String codeUrl;

    /**
     * 支付跳转链接
     */
    @SerializedName(value = "h5_url")
    @JsonProperty(value = "h5_url")
    @JSONField(name = "h5_url")
    private String h5Url;

    public String getPrepayId() {
        return prepayId;
    }

    public void setPrepayId(String prepayId) {
        this.prepayId = prepayId;
    }

    public String getCodeUrl() {
        return codeUrl;
    }

    public void setCodeUrl(String codeUrl) {
        this.codeUrl = codeUrl;
    }

    public String getH5Url() {
        return h5Url;
    }

    public void setH5Url(String h5Url) {
        this.h5Url = h5Url;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        TransactionsResponse that = (TransactionsResponse) o;
        return Objects.equals(prepayId, that.prepayId) &&
                Objects.equals(codeUrl, that.codeUrl) &&
                Objects.equals(h5Url, that.h5Url);
    }

    @Override
    public int hashCode() {
        return Objects.hash(prepayId, codeUrl, h5Url);
    }

    @Override
    public String toString() {
        return "TransactionsResponse{" +
                "prepayId='" + prepayId + '\'' +
                ", codeUrl='" + codeUrl + '\'' +
                ", h5Url='" + h5Url + '\'' +
                '}';
    }
}
